Skip to content

fix: guard escrow time arithmetic, escrow approval states, role count, and segment member_count - #744

Open
Akpolo wants to merge 1 commit into
ThinkLikeAFounder:mainfrom
Akpolo:fix/issues-721-722-723-724
Open

fix: guard escrow time arithmetic, escrow approval states, role count, and segment member_count#744
Akpolo wants to merge 1 commit into
ThinkLikeAFounder:mainfrom
Akpolo:fix/issues-721-722-723-724

Conversation

@Akpolo

@Akpolo Akpolo commented Jul 27, 2026

Copy link
Copy Markdown

Summary

Note: the existing test_release_disputed_escrow_fails test approved a disputed escrow before attempting release; with the #723 guard the approval itself now panics, so the test was reordered to approve before the dispute — its release-path assertion is unchanged.

Test plan

  • cargo test in contracts/audience-segments — 9 passed (new: test_segment_member_count_stays_in_sync)
  • cargo test in contracts/governance-core — 12 passed (new: test_revoke_after_expiry_cleanup_no_double_decrement)
  • cargo test in contracts/escrow-vault — 32 passed (new: test_approve_release_refunded_fails, test_approve_release_disputed_fails, test_create_escrow_time_lock_overflow, test_create_escrow_expires_at_overflow)

Closes #721
Closes #722
Closes #723
Closes #724

…, and segment member_count

- audience-segments: keep Segment.member_count in sync when members are
  added or removed, instead of leaving it permanently at 0
- governance-core: revoke_role only removes and decrements RoleCount when
  the grant actually exists, preventing a double decrement after has_role
  lazily cleans an expired grant
- escrow-vault: approve_release rejects Refunded and Disputed escrows in
  addition to Released
- escrow-vault: create_escrow computes time_lock_until and expires_at with
  checked_add so u64 overflow panics instead of wrapping to the past

Closes ThinkLikeAFounder#721
Closes ThinkLikeAFounder#722
Closes ThinkLikeAFounder#723
Closes ThinkLikeAFounder#724
@drips-wave

drips-wave Bot commented Jul 27, 2026

Copy link
Copy Markdown

@Akpolo Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment